@using AyBorg.Web.Pages.Agent.Shared
<MudDialog>
    <DialogContent>
        <div class="page-loading-bar">
            <MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-0" hidden="@(!_isLoading)" />
        </div>
        @foreach (var port in _ports)
        {
            <PortResolver Port="port" Ports="_ports" Mode="PortResolver.ListType.Device" ValueChanged="OnPortValueChangedAsync" Disabled="_isDisabled" />
        }
    </DialogContent>
    <DialogActions>
        <MudButton Color="Color.Default" OnClick="OnCloseClicked">Close</MudButton>
        @if(Device.IsConnected)
        {
            <MudButton Color="Color.Warning" StartIcon="@Icons.Material.Filled.PowerOff" OnClick="OnDisconnectClicked">Disconnect</MudButton>
        }
        else
        {
            <MudButton Color="Color.Success" StartIcon="@Icons.Material.Filled.Power" OnClick="OnConnectClicked">Connect</MudButton>
        }
        <MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="OnApplyClicked" Disabled="_isDisabled">Apply</MudButton>
    </DialogActions>
</MudDialog>
